import React, { Component } from 'react'
import RouterViews from '../../router/routerViews'
import { Tabbar } from 'react-vant';
import { Link } from 'react-router-dom';
export class DefaultPages extends Component {
  state = {
    active: 0,
  }
  myRef = React.createRef()
  setActive() {
    // this.setState({
    //   active:
    // })
  }

  render() {
    const { child, names } = this.props;
    return (
      <div className='default_warp'>
        <RouterViews routerLists={child}></RouterViews>
        <Tabbar activeColor="red" onChange={() => { this.setActive() }}>
          {
            names && names.length ? names.map((item, index) => {
              return <Tabbar.Item icon={item.icon} key={index} ><Link to={item.path}>{item.name}</Link></Tabbar.Item>
            }) : '暂无数据'
          }
        </Tabbar>
      </div>
    )
  }
}

export default DefaultPages